import { getStore } from "../../storage/storage"
import { axios } from "../../utils/axios"

// 通过当前登陆的账号查询收藏列表
export function getCurrentCollection(param){
    return axios({
        url: "/user-collection-comrecruit/getCurrentUserCollection",
        method: 'get',
        params: param,
        headers: {
            token: getStore("token")
        },
    })
}

// 用户收藏公司的岗位信息
export const userCollection = (param) =>{
    return axios({
        url: "/user-collection-comrecruit/userCollection",
        method: 'post',
        data: param,
        headers: {
            token: getStore("token")
        },
    })
}

// 判断当前这个职位是否被收藏
export const checkThisWorkIsCollection = (param) =>{
    return axios({
        url: "/user-collection-comrecruit/checkThisWorkIsCollection",
        method: 'get',
        params: param,
        headers: {
            token: getStore("token")
        },
    })
}

// 取消收藏
export const cancelCollection = (param) =>{
    return axios({
        url: "/user-collection-comrecruit/cancelCollection",
        method: 'post',
        data: param,
        headers: {
            token: getStore("token")
        },
    })
}

// 判断当前这个用户的意向工作是否被收藏
export const checkThisUserExpectWorkIsCollection = (param) =>{
    return axios({
        url: "/company-user-collection/checkThisUserExpectWorkIsCollection",
        method: 'get',
        params: param,
        headers: {
            token: getStore("token")
        },
    })
}

// 企业点击收藏
export const companyCollection = (params) =>{
    return axios({
        url: "/company-user-collection/companyCollection",
        method: 'post',
        data: params,
        headers: {
            token: getStore("token")
        },
    })
}

// 企业取消收藏用户的意向工作
export const cancelCollectUserExpectWork = (param) =>{
    return axios({
        url: "/company-user-collection/cancelCollectUserExpectWork",
        method: 'post',
        data: param,
        headers: {
            token: getStore("token")
        },
    })
}